<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      //   var arr = new Array();

      //   console.log(arr);

      //   var arr2 = [1, 2, 3];

      //   arr[0] = "宋";
      //   arr[1] = "红";
      //   arr[2] = "千";
      //   console.log(arr);

      //   arr[10] = '一'
      //   console.log(arr);

      //   console.log(arr[1]);

      // for( var i = 0 ; i<= arr.length ; i++){
      //     console.log(arr[i]);

      // }

      var arr3 = [1, 516, 8, 4, 6, 198, 75, 6, 4, 7946];
      var sum = 0;
      for (var i = 0; i < arr3.length; i++) {
        sum += arr3[i];
      }

      console.log(sum);
      console.log(sum / arr3.length);

      var max = arr3[0]
      for (var i = 0; i < arr3.length; i++) {
          if(max <= arr3[i]){
              max = arr3[i]
          }
      }

      console.log(max);


    var  str = ''
      
      for (var i = 0; i < arr3.length; i++) {
       

         if( i !== arr3.length -1  ){
            str +=  arr3[i] + '-'
         }
         else(
            str +=  arr3[i] 
         )
      }


      console.log(str);


      
     console.log(arr3.join('*'));

    
    </script>
  </body>
</html>
